package cn.tedu.store.util;

public class NumberUtils {

    public static Integer drawSurplus(Long nums,Integer pageNum){
        Long pageNums = pageNum.longValue();
        Long num=(nums%pageNums);
        if (num!=0){
            int surplus = num.intValue();
            return  surplus;
        }else {
            return pageNum;
        }
    }
    public static Integer totalPages(Long nums,Integer pageNum){
        Long pageNums = pageNum.longValue();
        Long num=(nums%pageNums);
        if (num!=0){
            Long number=(nums/pageNums);
            int pages = number.intValue()+1;
            return pages;
        }else {
            Long number=(nums/pageNums);
            int pages = number.intValue();
            return pages;
        }


    }

}
